using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class PKT_CustBalancesMap : EntityTypeConfiguration<PKT_CustBalances>
    {
        public PKT_CustBalancesMap()
        {
            // Primary Key
            this.HasKey(t => new { t.spid, t.id });

            // Properties
            this.Property(t => t.spid)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.id)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);

            this.Property(t => t.CustID)
                .HasMaxLength(10);

            this.Property(t => t.Acct)
                .HasMaxLength(40);

            this.Property(t => t.Cust_Reference)
                .HasMaxLength(20);

            // Table & Column Mappings
            this.ToTable("PKT_CustBalances");
            this.Property(t => t.spid).HasColumnName("spid");
            this.Property(t => t.id).HasColumnName("id");
            this.Property(t => t.CustID).HasColumnName("CustID");
            this.Property(t => t.MasterID).HasColumnName("MasterID");
            this.Property(t => t.CstCtrID).HasColumnName("CstCtrID");
            this.Property(t => t.OpeningBase1).HasColumnName("OpeningBase1");
            this.Property(t => t.OpeningBase2).HasColumnName("OpeningBase2");
            this.Property(t => t.OpeningAcct).HasColumnName("OpeningAcct");
            this.Property(t => t.MovementAcct).HasColumnName("MovementAcct");
            this.Property(t => t.MovementBase1).HasColumnName("MovementBase1");
            this.Property(t => t.MovementBase2).HasColumnName("MovementBase2");
            this.Property(t => t.BalanceAcct).HasColumnName("BalanceAcct");
            this.Property(t => t.BalanceBase1).HasColumnName("BalanceBase1");
            this.Property(t => t.BalanceBase2).HasColumnName("BalanceBase2");
            this.Property(t => t.Acct).HasColumnName("Acct");
            this.Property(t => t.Cust_Reference).HasColumnName("Cust_Reference");
        }
    }
}
